package com.tuocent.dagv2.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tuocent.dagv2.common.entity.ArchivesRetrospectData;
import com.tuocent.dagv2.entity.ArchivesInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;


/**
 * <p>
 * 档案加工信息 Mapper 接口
 * </p>
 *
 * @author Vincent
 * @since 2025-09-16
 */
@Mapper
public interface ArchivesInfoMapper extends BaseMapper<ArchivesInfo> {
    String dataSql = "SELECT a.id, a.archives_id, b.status, b.entity_status, b.batch_code, b.archival_code, " +
            "a.w1,a.w2,a.w3,a.w4, a.w5, a.w6, a.w7, a.w8, a.w8, a.w10, a.w11, a.w12, a.w13, a.w14, " +
            "a.w15, a.w18, a.w19, a.is_back, a.back_info, a.back_verify, a.back_verify_remark, a.arrange_info FROM " +
            " ${tableName} AS b left join db_archives_info AS a on b.id=a.archives_id ${ew.customSqlSegment}";

    @Select(dataSql)
    <P extends IPage<ArchivesRetrospectData>> P getArchivesRetrospectData(P page,
                                                                          @Param("ew") Wrapper<ArchivesRetrospectData> queryWrapper,
                                                                          @Param("tableName") String tableName);

}

